/**
 * @author ChaP
 * @date 2019/04/20
 * @describe:
 */
package CodingTest.AC20190421;

public class isSubsequence {
    public boolean isSubsequence(String s,String t){
        if(s.length() == 0) return true;
        int j =0;
        int count = 0;
        for(int i = 0;i<t.length();i++){
           if(t.charAt(i) == s.charAt(count)) count ++;
            if(count == s.length()) return true;
        }

         return false;

    }

    public static void main(String[] args) {
        String s = "abc";
        String t = "ahbgdc";
        isSubsequence is = new isSubsequence();
        System.out.println(is.isSubsequence(s,t));
    }
}
